package com.wpp.constant;

import java.util.HashMap;
import java.util.Map;

public class Constant {

    public static int PORT_SERVER_FIRST = 9010;

    public static int PORT_SERVER_SECOND = 9020;

    public static String SERVER_NAME_FIRST = "server1";

    public static String SERVER_NAME_SECOND = "server2";

    public static class ZkConfig {

        public static String IP_LOCALHOST = "127.0.0.1:2181";

        public static String REGISTER_ROOT = "/rpc-zkRegisters";

        public static String CONFIG_ROOT = "/rpc-zkConfigs";

        public static String SPILT = "/";

    }
    public static class DataSource {
        /* 配置数据源
         spring.datasource.driver-class-name=com.mysql.jdbc.Driver
         spring.datasource.url=jdbc:mysql://localhost:3306/test
         spring.datasource.username=root
         spring.datasource.password=*/
        public static String DRIVER_CLASS_NAME = "spring.datasource.driver-class-name";
        public static String URL = "spring.datasource.url";
        public static String USER_NAME = "spring.datasource.username";
        public static String PASSWORD = "spring.datasource.password";

        public static Map<String,String> DATASOURCE_MAP= new HashMap(){
            {
                put(DRIVER_CLASS_NAME,"com.mysql.jdbc.Driver");
                put(URL,"jdbc:mysql://localhost:3306/test?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true");
                put(USER_NAME,"root");
                put(PASSWORD,"root");
            }
        };

    }


}
